set(GRAPH_TEST_LIBS
    $<TARGET_OBJECTS:graph_obj>
    $<TARGET_OBJECTS:graph_thrift_obj>
    $<TARGET_OBJECTS:kvstore_storage_utils_obj>
    $<TARGET_OBJECTS:storage_service_handler>
    $<TARGET_OBJECTS:storage_client>
    $<TARGET_OBJECTS:storage_thrift_obj>
    $<TARGET_OBJECTS:common_thrift_obj>
    $<TARGET_OBJECTS:parser_obj>
    $<TARGET_OBJECTS:filter_obj>
    $<TARGET_OBJECTS:schema_obj>
    $<TARGET_OBJECTS:index_obj>
    $<TARGET_OBJECTS:dataman_obj>
    $<TARGET_OBJECTS:http_client_obj>
    $<TARGET_OBJECTS:ws_common_obj>
    $<TARGET_OBJECTS:storage_client>
    $<TARGET_OBJECTS:meta_client>
    $<TARGET_OBJECTS:meta_thrift_obj>
    $<TARGET_OBJECTS:meta_service_handler>
    $<TARGET_OBJECTS:kvstore_obj>
    $<TARGET_OBJECTS:raftex_obj>
    $<TARGET_OBJECTS:raftex_thrift_obj>
    $<TARGET_OBJECTS:wal_obj>
    $<TARGET_OBJECTS:time_obj>
    $<TARGET_OBJECTS:fs_obj>
    $<TARGET_OBJECTS:network_obj>
    $<TARGET_OBJECTS:thread_obj>
    $<TARGET_OBJECTS:thrift_obj>
    $<TARGET_OBJECTS:process_obj>
    $<TARGET_OBJECTS:base_obj>
    $<TARGET_OBJECTS:meta_gflags_man_obj>
    $<TARGET_OBJECTS:gflags_man_obj>
    $<TARGET_OBJECTS:ws_common_obj>
    $<TARGET_OBJECTS:stats_obj>
    $<TARGET_OBJECTS:charset_obj>
    $<TARGET_OBJECTS:encryption_obj>
    $<TARGET_OBJECTS:session_obj>
    $<TARGET_OBJECTS:permission_obj>
    $<TARGET_OBJECTS:convert_time_type_utils_obj>
)

set(GRAPH_TEST_CLIENT_LIBS
    $<TARGET_OBJECTS:graph_test_common_obj>
    $<TARGET_OBJECTS:client_cpp_obj>
    $<TARGET_OBJECTS:adHocSchema_obj>
    $<TARGET_OBJECTS:adHocIndex_obj>
)

nebula_add_library(
    graph_test_common_obj OBJECT
    TestMain.cpp
    TestEnv.cpp
    TestBase.cpp
)

nebula_add_test(
    NAME
        session_manager_test
    SOURCES
        SessionManagerTest.cpp
    OBJECTS
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
        gtest_main
)

nebula_add_test(
    NAME
        query_engine_test
    SOURCES
        SchemaTest.cpp
        ConfigTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        go_test
    SOURCES
        GoTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        data_test
    SOURCES
        DataTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        order_by_test
    SOURCES
        OrderByTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        fetch_vertices_test
    SOURCES
        FetchVerticesTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        fetch_edges_test
    SOURCES
        FetchEdgesTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        set_test
    SOURCES
        SetTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        delete_vertices_sentence_test
    SOURCES
        DeleteVerticesTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        delete_edges_sentence_test
    SOURCES
        DeleteEdgesTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        update_test
    SOURCES
        UpdateTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        find_path_test
    SOURCES
        FindPathTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        group_by_limit_test
    SOURCES
        GroupByLimitTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        yield_test
    SOURCES
        YieldTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        geo_test
    SOURCES
        GeoTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        snapshot_command_test
    SOURCES
        SnapshotCommandTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        index_test
    SOURCES
        IndexTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        lookup_test
    SOURCES
        LookupTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
    charsetCollate_test
    SOURCES
        CharsetCollateTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        user_test
    SOURCES
        UserTest.cpp
    OBJECTS
        $<TARGET_OBJECTS:graph_test_common_obj>
        $<TARGET_OBJECTS:client_cpp_obj>
        $<TARGET_OBJECTS:adHocSchema_obj>
        $<TARGET_OBJECTS:adHocIndex_obj>
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        permission_test
    SOURCES
        PermissionTest.cpp
    OBJECTS
        $<TARGET_OBJECTS:graph_test_common_obj>
        $<TARGET_OBJECTS:client_cpp_obj>
        $<TARGET_OBJECTS:adHocSchema_obj>
        $<TARGET_OBJECTS:adHocIndex_obj>
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    NAME
        ttl_test
    SOURCES
        TTLTest.cpp
    OBJECTS
        ${GRAPH_TEST_CLIENT_LIBS}
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)

nebula_add_test(
    DISABLED
    NAME
        cloud_account_auth_test
    SOURCES
        CloudAccountAuthTest.cpp
    OBJECTS
        $<TARGET_OBJECTS:graph_test_common_obj>
        $<TARGET_OBJECTS:client_cpp_obj>
        $<TARGET_OBJECTS:adHocSchema_obj>
        $<TARGET_OBJECTS:adHocIndex_obj>
        ${GRAPH_TEST_LIBS}
    LIBRARIES
        ${THRIFT_LIBRARIES}
        ${ROCKSDB_LIBRARIES}
        proxygenlib
        wangle
        gtest
)
